package com.echo.blog.business.sys.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.echo.blog.business.sys.dao.SysThirdUserMapper;
import com.echo.blog.business.sys.model.SysThirdUser;
import com.echo.blog.business.sys.service.ISysThirdUserService;
import com.echo.model.constant.ConstantUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author chentl123
 * @since 2019-05-28
 */
@Service
public class SysThirdUserServiceImpl extends ServiceImpl<SysThirdUserMapper, SysThirdUser> implements ISysThirdUserService {


    @Override
    public int selectCountByThirdId(Integer thirdId) {
        QueryWrapper<SysThirdUser> wrapper = new QueryWrapper<>();
        wrapper.eq(ConstantUtils.Public.THIRD_ID, thirdId);
        return this.count(wrapper);
    }

    @Override
    public SysThirdUser selectByUserName(String username) {
        QueryWrapper<SysThirdUser> wrapper = new QueryWrapper<>();
        wrapper.eq("login", username);
        return this.getOne(wrapper);
    }
}
